<template>
	<view class="bg-white work_item shadow">
		<view class=" d-flex j-sb a-center">
			<view class="font-lg line-h">{{ itemdata.serverProjectName }}</view>
			<view class="d-flex j-center a-center tagItem" v-if="itemdata.orderStatus === 0">未处理</view>
			<view class="d-flex j-center a-center tagItem border-success text-success" v-else>已处理</view>
		</view>
		<view class="orderInfo line-h font-md text-muted">
			单位：
			<text class="text-block">{{ itemdata.company }}</text>
		</view>
		<view class="orderInfo line-h font-md text-muted">
			联系人：
			<text class="text-block">{{ itemdata.linkman }}</text>
		</view>
		<view class="orderInfo line-h font-md text-muted">
			联系电话：
			<text class="text-block">{{ itemdata.phone }}</text>
		</view>
		<view class="orderInfo line-h font-md text-muted">
			申请时间：
			<text class="text-block">{{ itemdata.createTime | dateFormat }}</text>
		</view>
		<view class="orderInfo line-h font-md text-muted">
			处理时间：
			<!-- <text class="text-block">{{itemdata.completeTime&&(itemdata.completeTime｜dateFormat):'暂未处理'}}</text> -->
			<text class="text-block">{{ setCompleteTime(itemdata.proposerTime) }}</text>
		</view>

		<view class="seeview" hover-class="bg-light-secondary" @tap="seeView(itemdata.orderStatus)">查看进度</view>
	</view>
</template>

<script>
import { dateFormat } from '@/filter/index.js';
export default {
	filters: {
		dateFormat
	},
	props: {
		itemdata: {
			type: Object,
			default: () => {}
		},
		index: {
			type: Number,
			default: () => 0
		}
	},
	computed: {
		setCompleteTime() {
			return function(time) {
				return time ? dateFormat(time) : '暂未处理';
			};
		}
	},
	methods: {
		seeView(status) {
			const obj = {
				0: '负责人已接单，待处理',
				1: '已处理'
			};
			uni.showToast({
				title: obj[status],
				icon: 'none'
			});
			return;
		}
	}
};
</script>

<style lang="scss" scoped>
.work_item {
	width: 100%;
	height: 410rpx;
	border-radius: 8rpx;
	margin-top: 20rpx;
	padding: 34rpx 18rpx 0 30rpx;

	.orderInfo {
		margin-top: 20rpx;
	}

	.seeview {
		margin-top: 20rpx;
		font-size: 28rpx;
		font-weight: 400;
		width: 100%;
		text-align: center;
		color: #b2090a;
	}
}

.tagItem {
	width: 144rpx;
	height: 46rpx;
	color: #b2090a;
	border-radius: 58rpx;
	border: 2rpx solid #b2090a;
}
</style>
